package org.nepu.scr.indexrate.converter.riskrate.equipmentrisk;

import cn.hutool.json.JSONUtil;
import org.nepu.scr.indexrate.vo.riskrate.equipmentrisk.WellheadToolsB225;

import javax.persistence.AttributeConverter;
import javax.persistence.Convert;

@Convert
public class WellheadToolsB225Converter implements AttributeConverter<WellheadToolsB225, String> {
    @Override
    public String convertToDatabaseColumn(WellheadToolsB225 wellheadToolsB225) {
        return JSONUtil.toJsonStr(wellheadToolsB225);
    }

    @Override
    public WellheadToolsB225 convertToEntityAttribute(String s) {
        return JSONUtil.toBean(s, WellheadToolsB225.class);
    }
}
